package com.linkage.lcims.base.dao.business.impl;

import java.util.List;
import java.util.Map;

import com.linkage.lcims.base.dao.HibernateBaseDAOImpl;
import com.linkage.lcims.base.dao.business.interfaces.TollPolicyDAO;
import com.linkage.lcims.base.po.business.BdTollPolicy;
import com.linkage.util.exception.DAOException;

public class TollPolicyDAOImpl extends HibernateBaseDAOImpl implements
		TollPolicyDAO {
	
	private static final String PO_CLASS = "com.linkage.lcims.base.po.business.BdTollPolicy";
	
	public TollPolicyDAOImpl() {
		// TODO Auto-generated constructor stub
		super();
	}

	@SuppressWarnings("unchecked")
	public List<BdTollPolicy> getAll() throws DAOException {
		// TODO Auto-generated method stub
		return this.getAll(BdTollPolicy.class);
	}

	public BdTollPolicy getTollPolicy(BdTollPolicy bdTollPolicy)
			throws DAOException {
		// TODO Auto-generated method stub
		return (BdTollPolicy)this.getByID(BdTollPolicy.class, bdTollPolicy.getPolicyid());
	}

	public void saveTollPolicy(BdTollPolicy bdTollPolicy) throws DAOException {
		// TODO Auto-generated method stub
		this.save(bdTollPolicy);
	}

	public void updateTollPolicy(BdTollPolicy bdTollPolicy) throws DAOException {
		// TODO Auto-generated method stub
		this.merge(bdTollPolicy);
	}

	public void deleteTollPolicy(BdTollPolicy bdTollPolicy) throws DAOException {
		// TODO Auto-generated method stub
		this.delete(bdTollPolicy);
	}

	public void updateFields(Object id, Map<String,Object> fieldValues) throws DAOException {
		// TODO Auto-generated method stub
		this.updateField(PO_CLASS,id,fieldValues);
	}

}
